package com.pro.controller;

import com.pro.pojo.JsAuditLog;
import com.pro.pojo.JsonData;
import com.pro.service.JsAuditLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName:JsAuditLogController
 * Package:com.pro.controller
 * Description:
 *
 * @Date:2022/1/15 11:37
 * @Author: ZPT
 */
@RestController
@RequestMapping("/aduitLog")
public class JsAuditLogController {
    @Autowired
    private JsAuditLogService auditLogService;
    /**
     *
     * @author ZPT
     * @date 2022/1/15 11:42
     * @content :查询审核日志数据
     */
    @RequestMapping("/getAuditLog")
    public JsonData getAuditLog(String trueName, Integer aduitLogType, String createDate){
        List<JsAuditLog> auditLogList = auditLogService.getAuditLog(trueName, aduitLogType, createDate);
        return auditLogList!=null?JsonData.buildSuccess(auditLogList):JsonData.buildError("服务端错误");
    }
    /**
     *
     * @author ZPT
     * @date 2022/1/15 13:38
     * @content :添加审核日志
     */
    @RequestMapping("/addAuditLog")
    public JsonData addAuditLog(JsAuditLog auditLog){
        Boolean addBoolean = auditLogService.addAuditLog(auditLog);
        return addBoolean!=null?JsonData.buildSuccess(addBoolean):JsonData.buildError("服务端错误");
    }
}
